import { EnumBusinessTripType, EnumKnowledgeExtendType, EnumMemberSalaryType, EnumOvertimeType, EnumScene, EnumWelfare, EnumWorkTime, type AddressModel, type KnowledgeDetailResult, type ProbationModel, type SalaryModel, type WorkTimeModel } from "@/api/siderBar/model";
import type { Dayjs } from "@/utils/dayjs";

interface EntryTypeBasic<T extends string | number | boolean = string> extends KnowledgeDetailResult {
    index: number
    extendOptionsNormalized: INullable<IOption<T>[]>
}
export interface EntryTypeNormal extends EntryTypeBasic {
    scene: EnumScene.默认;
    ui: {
        reply?: string
    }
}
export interface EntryTypeNull extends EntryTypeBasic {
    scene: EnumScene.扩展;
    extendType: EnumKnowledgeExtendType.无
    ui: {
        reply?: string
    }
}
export interface EntryTypeWorktime extends EntryTypeBasic {
    scene: EnumScene.工作时间;
    ui: {
        restMode: EnumWorkTime
        workStart?: Dayjs
        workEnd?: Dayjs
        reply?: string
    }
    /** just for marking type */
    extendParams?: WorkTimeModel
}
export interface EntryTypeWorkContinue extends EntryTypeBasic {
    scene: EnumScene.加班;
    ui: {
        restMode: EnumOvertimeType
        reply?: string
    }
    /** just for marking type */
    extendParams?: EnumOvertimeType
}
export interface EntryTypeWorkAddress extends EntryTypeBasic {
    scene: EnumScene.工作地点;
    ui: {
        place?: number
        reply?: string
    }
    /** just for marking type */
    extendParams?: AddressModel
}
export interface EntryTypeSalary extends EntryTypeBasic {
    scene: EnumScene.薪酬;
    ui: {
        composition: EnumMemberSalaryType
        salary?: number
        salaryMin?: number
        reply?: string
    }
    /** just for marking type */
    extendParams?: SalaryModel
}
export interface EntryTypeTry extends EntryTypeBasic {
    scene: EnumScene.试用期;
    ui: {
        duration?: number
        salaryMin?: number
        reply?: string
    }
    /** just for marking type */
    extendParams?: ProbationModel
}
export interface EntryTypeWelfare extends EntryTypeBasic<EnumWelfare> {
    scene: EnumScene.福利;
    ui: {
        chooses: EnumWelfare[]
        reply?: string
    }
    /** just for marking type */
    extendParams?: EnumWelfare[]
}
export interface EntryTypeTrip extends EntryTypeBasic<EnumBusinessTripType> {
    scene: EnumScene.出差;
    ui: {
        choose?: EnumBusinessTripType
        reply?: string
    }
    /** just for marking type */
    extendParams?: EnumBusinessTripType
}
export interface EntryTypeOptionSingle extends EntryTypeBasic {
    scene: EnumScene.扩展;
    extendType: EnumKnowledgeExtendType.单选
    ui: {
        choose?: string | number
        reply?: string
    }
    /** just for marking type */
    extendParams?: (string | number)[]
}
export interface EntryTypeOptionMultiple extends EntryTypeBasic {
    scene: EnumScene.扩展;
    extendType: EnumKnowledgeExtendType.多选
    ui: {
        chooses: (string | number)[]
        reply?: string
    }
    /** just for marking type */
    extendParams?: (string | number)[]
}
export type EntryType = 
    | EntryTypeNormal
    | EntryTypeNull
    | EntryTypeWorktime
    | EntryTypeWorkContinue
    | EntryTypeWorkAddress
    | EntryTypeSalary
    | EntryTypeTry
    | EntryTypeWelfare
    | EntryTypeTrip
    | EntryTypeOptionSingle
    | EntryTypeOptionMultiple
